package com.maoshi.shop.api.controller;

import com.maoshi.shop.bean.model.MyDistance;
import com.maoshi.shop.service.MyDistanceService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@RestController
@RequestMapping("/myDistance")
@AllArgsConstructor
public class MyDistanceController {
    @Autowired
    private MyDistanceService myDistanceService;

    @GetMapping("/maxDistance")
    @ApiOperation(value = "获取最远配送距离", notes = "根据id获取最远配送距离")
    public ResponseEntity<MyDistance> maxDistance(Long id) {
        return ResponseEntity.ok(myDistanceService.getMaxDistance(id));
    }
}
